From c77cce304cf14254aeb77218c3c1e306380ec4eb Mon Sep 17 00:00:00 2001 From: tsteven4 <13596209+tsteven4@users.noreply.github.com> Date: Sat, 9 Sep 2023 07:32:31 -0600 Subject: [PATCH] use noreturn attribute --- jeeps/gpsutil.h | 2 +- jeeps/jgpsutil.cc | 2 +- shape.cc | 2 +- shape.h | 2 +- unicsv.cc | 2 +- unicsv.h | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/jeeps/gpsutil.h b/jeeps/gpsutil.h index 741d31a59..55ec8b0ba 100644 --- a/jeeps/gpsutil.h +++ b/jeeps/gpsutil.h @@ -22,7 +22,7 @@ void GPS_Warning(const char* s); [[gnu::format(printf, 1, 2)]] void GPS_Error(const char* fmt, ...); [[gnu::format(printf, 1, 2)]] void GPS_Serial_Error(const char* fmt, ...); - void GPS_Fatal(const char* s); + [[noreturn]] void GPS_Fatal(const char* s); void GPS_Enable_Error(); void GPS_Enable_Warning(); void GPS_Disable_Error(); diff --git a/jeeps/jgpsutil.cc b/jeeps/jgpsutil.cc index 0f522005f..a462201af 100644 --- a/jeeps/jgpsutil.cc +++ b/jeeps/jgpsutil.cc @@ -475,7 +475,7 @@ void GPS_Warning(const char* s) ** @@ ****************************************************************************/ -void GPS_Fatal(const char* s) +[[noreturn]] void GPS_Fatal(const char* s) { fprintf(stderr,"[FATAL] %s\n",s); diff --git a/shape.cc b/shape.cc index 94321902b..318c1a193 100644 --- a/shape.cc +++ b/shape.cc @@ -144,7 +144,7 @@ ShapeFormat::DBFCreateGpsbabel(const QString& pszFilename) } #endif -void ShapeFormat::dump_fields() const +[[noreturn]] void ShapeFormat::dump_fields() const { char name[12]; warning(MYNAME ": Database fields:\n"); diff --git a/shape.h b/shape.h index 3d1c0b9f1..04b59a0db 100644 --- a/shape.h +++ b/shape.h @@ -65,7 +65,7 @@ private: static SHPHandle SHPAPI_CALL SHPCreateGpsbabel(const QString& pszLayer, int nShapeType); static DBFHandle SHPAPI_CALL DBFOpenGpsbabel(const QString& pszFilename, const char* pszAccess); static DBFHandle SHPAPI_CALL DBFCreateExGpsbabel(const QString& pszFilename, const char* pszCodePage); - void dump_fields() const; + [[noreturn]] void dump_fields() const; void check_field_index(int fieldIdx) const; int get_field_index(const QString& fieldName) const; void write_wpt(const Waypoint* wpt) const; diff --git a/unicsv.cc b/unicsv.cc index 480616934..fd4ee9839 100644 --- a/unicsv.cc +++ b/unicsv.cc @@ -1078,7 +1078,7 @@ UnicsvFormat::read() /* =========================================================================== */ void -UnicsvFormat::unicsv_fatal_outside(const Waypoint* wpt) const +[[notreturn]] UnicsvFormat::unicsv_fatal_outside(const Waypoint* wpt) const { *fout << "#####\n"; fatal(MYNAME ": %s (%s) is outside of convertible area of grid \"%s\"!\n", diff --git a/unicsv.h b/unicsv.h index ce564508d..021e65a89 100644 --- a/unicsv.h +++ b/unicsv.h @@ -174,7 +174,7 @@ private: static bool unicsv_compare_fields(const QString& s, const field_t* f); void unicsv_fondle_header(QString header); void unicsv_parse_one_line(const QString& ibuf); - void unicsv_fatal_outside(const Waypoint* wpt) const; + [[noreturn]] void unicsv_fatal_outside(const Waypoint* wpt) const; void unicsv_print_str(const QString& s) const; void unicsv_print_date_time(const QDateTime& idt) const; void unicsv_waypt_enum_cb(const Waypoint* wpt); -- 2.30.2